﻿<UserControl 
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:base="clr-namespace:Flare.DB"
             xmlns:conv="clr-namespace:Flare.Converter"
             xmlns:Controls="clr-namespace:Flare.Controls" 
             x:Class="Flare.Pages.Endpoint.Index"
             DataContext="{Binding RelativeSource={RelativeSource Self}}"
             mc:Ignorable="d" 
             d:DesignHeight="600" d:DesignWidth="1200">
    <UserControl.Resources>
        <ObjectDataProvider x:Key="endpointsDataSet" ObjectType="{x:Type base:endpoints}" MethodName="Index" IsAsynchronous="False">
            <ObjectDataProvider.MethodParameters>
                <x:Null/>
                <x:Null/>
                <x:Null/>
                <x:Null/>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>

        <ObjectDataProvider x:Key="general_departmentsDataSet" ObjectType="{x:Type base:general_departments}" MethodName="Index" IsAsynchronous="False" />

        <ObjectDataProvider x:Key="general_roomsDataSet" ObjectType="{x:Type base:general_rooms}" MethodName="Index" IsAsynchronous="False">
            <ObjectDataProvider.MethodParameters>
                <x:Null/>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>

        <ObjectDataProvider x:Key="endpoint_typesDataSet" ObjectType="{x:Type base:endpoint_types}" MethodName="Index" IsAsynchronous="False"/>
    </UserControl.Resources>

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="208" />
            <ColumnDefinition Width="92"/>
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Top" Grid.ColumnSpan="2">

            <Controls:FlameMenu x:Name="Department" Caption="Отдел" SelectedValuePath="id_department" DisplayMemberPath="department" DockPanel.Dock="Top" 
                                ItemsSource="{Binding Source={StaticResource general_departmentsDataSet}}" 
                                SelectedValue="{Binding id_department, Mode=OneWay}" SelectionChanged="Department_SelectionChanged" />

            <Controls:FlameMenu x:Name="Room" Caption="Кабинет" SelectedValuePath="id_room" DisplayMemberPath="room" DockPanel.Dock="Top"
				ItemsSource="{Binding Source={StaticResource general_roomsDataSet}}" SelectedValue="{Binding id_room, Mode=OneWay}" SelectionChanged="Room_SelectionChanged" />

            <Controls:FlameMenu x:Name="netType" Caption="Тип" SelectedValuePath="id_type" HorizontalAlignment="Stretch" DockPanel.Dock="Top" DisplayMemberPath="type"
                                ItemsSource="{Binding Source={StaticResource endpoint_typesDataSet}}" SelectedValue="{Binding id_nettype, Mode=OneWay}" 
                                SelectionChanged="netType_SelectionChanged" />

            <Label x:Name="ClearFilter"  Content="Удалить фильтр" DockPanel.Dock="Top" Margin="5,40,5,5" HorizontalAlignment="Right"
				Style="{StaticResource StyleUrl}"  PreviewMouseLeftButtonUp="ClearFilter_PreviewMouseLeftButtonUp" />
        </DockPanel>

        <ListBox x:Name="netList" Style="{StaticResource StyleListBox}" Grid.Column="2" ItemsSource="{Binding IsAsync=True, Source={StaticResource endpointsDataSet}}" 
			 SelectedValuePath="id" Margin="20,0" ItemContainerStyle="{StaticResource NetworkListItemTemplate}" SelectionChanged="netList_SelectionChanged">
        </ListBox>
    </Grid>

</UserControl>
